﻿/////////////////////////////////////////////////////////////////
//     .--.
//    |o_o |    StockADT.cs
//    |:_/ |        Implementación de la clase StockADT
//   //   \ \   Created on:
//  (|     | )      18-abr-2009 21:15:42
// /'\_   _/`\  Original author:
// \___)=(___/      The SoftTux Team
/////////////////////////////////////////////////////////////////

using System;

namespace RSSReader
{
    public class StockADT
    {
        private string name;
        private double last, change, changep;
        private int volume;

        public int Volume
        {
            get { return volume; }
            set { volume = value; }
        }

        public double Last
        {
            get { return last; }
            set { last = value; }
        }

        public double Change
        {
            get { return change; }
            set { change = value; }
        }

        public double Changep
        {
            get { return changep; }
            set { changep = value; }
        }

        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        /// <summary>
        /// constructor de StockADT
        /// </summary>
        /// <param name="name">el acrónimo de la empresa</param>
        /// <param name="last">el valor actual de una acción</param>
        /// <param name="change">el beneficio/perdida</param>
        /// <param name="changep">el beneficio/perdida en porcentaje</param>
        /// <param name="volume">volumen de empresa</param>
        public StockADT(string name, double last, double change, double changep, int volume)
        {
            this.name = name;
            this.last = last;
            this.change = change;
            this.changep = changep;
            this.volume = volume;
        }

        /// <summary>
        /// constructor simple. solo se especifica el acrónimo de la empresa
        /// los demas valores son inicializados a 0
        /// </summary>
        /// <param name="name">el acrónimo de la empresa</param>
        public StockADT(string name)
        {
            this.name = name;
            this.last = 0.0;
            this.change = 0.0;
            this.changep = 0.0;
            this.volume = 0;
        }

        public override string ToString()
        {
            return "Stock name: " + this.name + ".\nLast value: " + this.last + ".\nChange: " + this.change + ".\nChange (%): " + this.changep + ".\nVolume: " + this.volume + ".\n";
        }

    }
}
